package com.lee.easyExcel;

import com.alibaba.excel.EasyExcel;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Date;

/**
 * TODO
 *
 * @className: SimpleWrite
 * @author: lx
 * @date: 2021-02-24
 **/
public class SimpleWrite {


    @Test
    public void test() {
        ArrayList<DemoData> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            DemoData demoData = new DemoData();
            demoData.setDate(new Date());
            demoData.setString("aaaa");
            list.add(demoData);
        }

        EasyExcel.write("demo1.xlsx", DemoData.class).sheet("模板").doWrite(list);
    }

}
